package org.apoiolivre.model;

import java.util.Date;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

@PersistenceCapable
public class Movement extends ALEntity {

	
	@Persistent
	private Key kind;
	
	@Persistent
	private Key category;
	
	@Persistent
	private Movement parent;

	@Persistent
	private String description;

	@Persistent
	private Double value;

	@Persistent
	private Integer quantity;

	@Persistent
	private Date date;
	
	

	public Movement() { }

	public Movement(User user, Double value, Integer quantity,
			String description, Category cat, MovementKind kind) {
		this.author = user;
		this.date = new Date();
		this.category = cat.getKey();
		this.kind = kind.getKey();
		this.value = value;
		this.quantity = quantity;
		this.description = description;
	}


	public String getDescription() {
		return description;
	}

	public Date getDate() {
		return date;
	}

	public void setDescription(String content) {
		this.description = content;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Double getValue() {
		return value;
	}

	public void setValue(Double value) {
		this.value = value;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Key getKind() {
		return kind;
	}

	public void setKind(Key kind) {
		this.kind = kind;
	}

	public Key getCategory() {
		return category;
	}

	public void setCategory(Key category) {
		this.category = category;
	}

	public Movement getParent() {
		return parent;
	}

	public void setParent(Movement parent) {
		this.parent = parent;
	}
	
	
	
}
